﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="Insert.aspx.cs" Inherits="BaseSRS_CPRequests.Insert" %>

<asp:Content ID="headContent" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true">
        <DataControls>
            <asp:DataControlReference ControlID="FormView1" />
        </DataControls>
    </asp:DynamicDataManager>

    <h2 class="DDSubHeader">Submit a New Item</h2>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

            <asp:DynamicValidator runat="server" ID="DetailsViewValidator" ControlToValidate="FormView1" Display="None" CssClass="DDValidator" />

            <asp:FormView runat="server" ID="FormView1" DataSourceID="DetailsDataSource" DefaultMode="Insert"
                OnItemCommand="FormView1_ItemCommand" OnItemInserted="FormView1_ItemInserted" RenderOuterTable="False">
                
                <InsertItemTemplate>
                    <div class="SRSGenericPage">
                        DESCRIPTION: Please enter a brief description of this Item<br />
                        <asp:DynamicControl ID="DescriptionDynamicControl1" runat="server" DataField="Description" Mode="Insert" ValidationGroup="Insert" />
                        <br /><br />
                        NOTE: Include all relevant Item details in the area provided below
                        <br />
                        <asp:DynamicControl ID="DescriptionDynamicControl2" runat="server" DataField="Details" Mode="Insert" ValidationGroup="Insert" />
                        <br />
                    </div>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Insert" Text="Submit" CssClass="SRSButtonGO" SkinID="SRSSubmitButton" ValidationGroup="Insert"><img align="top" src="../../../Images/save.png" alt="Cancel" border="0"/>&nbsp;Submit&nbsp;&nbsp;</asp:LinkButton>
                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Cancel" Text="Cancel" CausesValidation="false" CssClass="SRSButtonNO" SkinID="SRSCancelButton"><img align="top" src="../../../Images/cancel.png" alt="Cancel" border="0"/>&nbsp;Cancel&nbsp;&nbsp;</asp:LinkButton>

                </InsertItemTemplate>
                
                <ItemTemplate>
                    <asp:DynamicControl ID="DescriptionDynamicControl" runat="server" DataField="Description" Mode="ReadOnly" ApplyFormatInEditMode="True" />
                    <br />
                </ItemTemplate>

            </asp:FormView>

            <asp:EntityDataSource ID="DetailsDataSource" runat="server" ConnectionString="name=srsremoteEntities" DefaultContainerName="srsremoteEntities" EnableFlattening="False" EntitySetName="Requests" EntityTypeFilter="Request" Select="it.[Description]" EnableInsert="true" />
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

